<template>
  <Card style="margin-bottom: 10px;">
    <div class="history-info">
      <div class="history-img">
        <a @click="showDetailInfo(obj.key)">
          <img :src="obj.img">
        </a>
      </div>
      <div>
        <div class="history-info">
          <div class="history-title">
            <a @click="showDetailInfo(obj.key)">
              {{ obj.title }}
            </a>
          </div>
          <div class="history-class">
            {{ obj.classes}}
          </div>
        </div>
        <div class="history-desc">
         {{ obj.desc }}
          <a href="javascript:void (0)" @click="showDetailInfo(obj.key)">&gt;&gt;详情</a>
        </div>
      </div>
    </div>
  </Card>
</template>

<script>
  export default {
    name: "HistoryInfoCard",
    props: {
      obj: {
        Object,
        default: () => {}
      }
    },
    methods: {
      showDetailInfo(key) {
        this.$router.push({
          path: '/hospital-info',
          query: {
            key: key
          }
        })
      }
    }
  }
</script>

<style lang="less" scoped>
  .history-info {
    display: flex;
    .history-img {
      width: 170px;
      height: 140px;
      margin: 10px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .history-info {
      display: flex;
      margin: 10px;
      .history-title {
        width: 500px;
        height: 25px;
        font-size: 18px;
        font-weight: bold;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        word-break: break-all;
        a {
          color: #000;
          &:hover {
            color: #4758ff;
          }
        }
      }
      .history-class {
        width: 200px;
        height: 25px;
      }
    }
    .history-desc {
      margin: 10px;
      width: 920px;
      font-size: 14px;
      a {
        color: #000;
        &:hover {
          color: #4758ff;
        }
      }
    }
  }
</style>
